using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Logic.Units;

namespace GameApplication.Helper
{
    public static class Extension
    {
        public static String Name(this IUnit unit)
        {
            return unit.GetType().Name;
        }

        public static ObservableCollection<UnitWpf> ToWpf(this IEnumerable<IUnit> unit)
        {
            if (unit == null) throw new ArgumentNullException("unit");
            return new ObservableCollection<UnitWpf>(unit.Select(x => new UnitWpf(x)).ToList());
        }
    }
}